package com.github.ghsea.scheduler.repository;

import com.github.ghsea.scheduler.entity.TaskSchedulerEntity;
import java.util.Date;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author guhai
 * @since 2021/6/18 0:38
 */

@Mapper
@Repository
public interface TaskSchedulerRepository {

    /**
     * 查询一条宕机的TaskScheduler
     * @return
     */
    TaskSchedulerEntity getCrashedTaskScheduler();

    TaskSchedulerEntity queryHearbeartByServer(@Param("server") String server);

    void updateHeatbeatByServer(TaskSchedulerEntity taskSchedulerEntity);

    void insert(TaskSchedulerEntity taskSchedulerEntity);

}
